#include <cmath>
#include <cstring>

#include "Vector.h"

namespace BlobSalladDS
{
	Vector::Vector(double x, double y)
	{
		this->x = x;
		this->y = y;
	}

	bool Vector::equal(Vector &v)
	{
		return this->x == v.getX() && this->y == v.getY();;
	}

	double Vector::getX()
	{
		return this->x;
	}

	double Vector::getY()
	{
		return this->y;
	}

	void Vector::setX(double x)
	{
		this->x = x;
	}

	void Vector::setY(double y)
	{
		this->y = y;
	}

	void Vector::addX(double x)
	{
		this->x += x;
	}

	void Vector::addY(double y)
	{
		this->y += y;
	}

	void Vector::set(Vector &v)
	{
		this->x = v.getX();
		this->y = v.getY();
	}

	void Vector::add(Vector &v)
	{
		this->x += v.getX();
		this->y += v.getY();
	}

	void Vector::sub(Vector &v)
	{
		this->x -= v.getX();
		this->y -= v.getY();
	}

	double Vector::dotProd(Vector &v)
	{
		return this->x * v.getX() + this->y * v.getY();
	}

	double Vector::length()
	{
		return sqrt(this->x * this->x + this->y * this->y);
	}

	void Vector::scale(double scaleFactor)
	{
		this->x *= scaleFactor;
		this->y *= scaleFactor;
	}

	char* Vector::toString()
	{
		return NULL;
	}
}
